<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let name = 'lucy'
        let age = 20
        let person1 = {name,age}

        let sex = 'male'
        let person2 = {sex}
        
        //对象赋值于合并
        let copyPerson = {...person1,...person2}
        console.log(copyPerson)
    </script>
</body>
</html>